cmake_minimum_required(VERSION 3.0.2)
project(linefit_ground)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O3")
set(CMAKE_CXX_STANDARD 17)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
        roscpp
        pcl_ros
        pcl_conversions
        tf
        eigen_conversions
        cv_bridge#可以将sensor/Image 和OpenCV关联起来
        sensor_msgs
        image_transport
        nav_msgs
)

find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})

find_package(PCL REQUIRED QUIET)
find_package(OpenCV REQUIRED QUIET)
include(cmake/glog.cmake)

catkin_package(
        INCLUDE_DIRS include
        #  LIBRARIES Obstacle-Cluster
        #  CATKIN_DEPENDS roscpp
        #  DEPENDS system_lib
)

include_directories(
        include
        ${catkin_INCLUDE_DIRS}
        ${PCL_INCLUDE_DIRS}
        ${OpenCV_INCLUDE_DIRS}
)

link_directories(
        include
        ${OpenCV_LIBRARY_DIRS}
        ${PCL_LIBRARY_DIRS}
)

file(GLOB_RECURSE ALL_SRC "src/*.cc")
file(GLOB_RECURSE ALL_SRC_CPP "src/*.cpp")

#add_executable(GroundSegNodeEud node/ground_segmentation_node.cc ${ALL_SRC})
#add_dependencies(GroundSegNodeEud ${catkin_EXPORTED_TARGETS})
#target_link_libraries(GroundSegNodeEud ${catkin_LIBRARIES} ${ALL_TARGET_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${GLOG_LIBRARIES})
##
#add_executable(GroundSegNodetest node/ground_segmentation_test_node.cc ${ALL_SRC})
#add_dependencies(GroundSegNodetest ${catkin_EXPORTED_TARGETS})
#target_link_libraries(GroundSegNodetest ${catkin_LIBRARIES} ${ALL_TARGET_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${GLOG_LIBRARIES})
#
#add_executable(GroundSegNodeDepthIOU node/groundSeg_Depth_IOU.cc ${ALL_SRC} ${ALL_SRC_CPP})
#add_dependencies(GroundSegNodeDepthIOU ${catkin_EXPORTED_TARGETS})
#target_link_libraries(GroundSegNodeDepthIOU ${catkin_LIBRARIES} ${ALL_TARGET_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${GLOG_LIBRARIES})

add_executable(GroundSegNodeDepth node/groundSeg_Depth.cc ${ALL_SRC} ${ALL_SRC_CPP})
add_dependencies(GroundSegNodeDepth ${catkin_EXPORTED_TARGETS})
target_link_libraries(GroundSegNodeDepth ${catkin_LIBRARIES} ${ALL_TARGET_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${GLOG_LIBRARIES})


#add_executable(GroundSegNodeDepthCamera node/groundSeg_DeepCamera.cc src/DrivableSeg.cpp ${ALL_SRC} ${ALL_SRC_CPP})
#add_dependencies(GroundSegNodeDepthCamera ${catkin_EXPORTED_TARGETS})
#target_link_libraries(GroundSegNodeDepthCamera ${catkin_LIBRARIES} ${ALL_TARGET_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${GLOG_LIBRARIES})

#add_executable(GroundSegSavePCD node/groundSeg_SavePCD.cc ${ALL_SRC} ${ALL_SRC_CPP})
#add_dependencies(GroundSegSavePCD ${catkin_EXPORTED_TARGETS})
#target_link_libraries(GroundSegSavePCD ${catkin_LIBRARIES} ${ALL_TARGET_LIBRARIES} ${PCL_LIBRARIES} ${OpenCV_LIBRARIES} ${GLOG_LIBRARIES})

